API Documentation
Public Member Functions | Public Attributes | List of all members
nkGraphics::RenderContextDescriptor Class Referencefinal

A descriptor, used when creating a context along with its window. More...

Public Member Functions

 RenderContextDescriptor ()
 
 RenderContextDescriptor (nkWinUi::GraphicsWindow *window)
 
 RenderContextDescriptor (nkGraphics::Texture *texture)
 
 RenderContextDescriptor (unsigned int width, unsigned int height, bool forOffscreen)
 
 ~RenderContextDescriptor ()
 

Public Attributes

unsigned int _width
 The width of the context, in pixels. Defaults to 1.
 
unsigned int _height
 The height of the context, in pixels. Defauls to 1.
 
union {
   nkWinUi::GraphicsWindow *   _window
 For non off-screen context creation, an already existing window can be specified here. Defaults to nullptr, triggering an automatic window creation.
 
   Texture *   _texture
 For off-screen context creation, an already existing texture to work on. Defaults to nullptr, triggering an automatic texture creation.
 
}; 
 
bool _offscreenContext
 If the context should be used for offscreen rendering (no window created, only works with texture). Defaults to false.
 

Detailed Description

A descriptor, used when creating a context along with its window.

See RenderContextManager::createRenderContext() for more information.

Constructor & Destructor Documentation

◆ RenderContextDescriptor() [1/4]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( )

Default constructor.

◆ RenderContextDescriptor() [2/4]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( nkWinUi::GraphicsWindow *  window)

On window constructor.

Parameters
windowThe window the context described should render to.
Remarks
The context will be considered as rendering on screen, and size will be derived from the window given.

◆ RenderContextDescriptor() [3/4]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( nkGraphics::Texture *  texture)

On texture constructor.

Parameters
textureThe texture the context described should render to.
Remarks
The context will be considered as rendering off screen, and size will be derived from the texture given.

◆ RenderContextDescriptor() [4/4]

nkGraphics::RenderContextDescriptor::RenderContextDescriptor ( unsigned int  width,
unsigned int  height,
bool  forOffscreen 
)

Automatic constructor.

Parameters
widthThe width of the context described, in pixels.
heightThe height of the context described, in pixels.
forOffscreenWhether the context described should be off-screen (true) or not (false).
Remarks
For on-screen contexts, a window will be created, while off-screen contexts will create a texture.

◆ ~RenderContextDescriptor()

nkGraphics::RenderContextDescriptor::~RenderContextDescriptor ( )

Destructor.


The documentation for this class was generated from the following file: